import { sendRequest } from '@/http';

export function getDevices(params: any) {
  return sendRequest({
    url: `/device/getDevices`,
    method: 'get',
    params,
  });
}

export function getRepairLogs(deviceId: string) {
  return sendRequest({
    url: `/device/getRepairLogs`,
    method: 'get',
    params: { deviceId },
  });
}

export function getDeviceModels() {
  return sendRequest({
    url: `/device/getDeviceModels`,
    method: 'get',
  });
}

export function getDeviceBindLogs(params: any) {
  return sendRequest({
    url: `/device/getDeviceBindLogs`,
    method: 'get',
    params,
  });
}

export function bindElderDevice(data: any) {
  return sendRequest({
    url: `/device/bindElderDevice`,
    method: 'post',
    data,
  });
}

export function deleteDevice(deviceId: any) {
  return sendRequest({
    url: `/device/delete`,
    method: 'post',
    data: { deviceId },
  });
}

export function reportRepair(data: any) {
  return sendRequest({
    url: `/device/reportRepair`,
    method: 'post',
    data,
  });
}

export function resolveRepair(data: any) {
  return sendRequest({
    url: `/device/resolveRepair`,
    method: 'post',
    data,
  });
}

export function unbindElderDevice(data: any) {
  return sendRequest({
    url: `/device/unbindElderDevice`,
    method: 'post',
    data,
  });
}

export function getDeviceEvents(params: any) {
  return sendRequest({
    url: `/device/getDeviceEvents`,
    method: 'get',
    params,
  });
}

export function addDevice(data: any) {
  return sendRequest({
    url: `/device/addDevice`,
    method: 'post',
    data,
  });
}

export function disposeAlarm(data: any) {
  return sendRequest({
    url: `/device/disposeAlarm`,
    method: 'post',
    data,
  });
}
